package edu.sctu.practice.class01.xiangkun.assign03.demoone;

/**
 * Created by xiangkun on 2015/10/22.
 */
public class Circle extends GeometricObject {

    protected double radius;
    public Circle()
    {
        this(1.0, "white", 1.0);
    }

    public Circle(double radius) {
        super("white", 1.0);
        this.radius = radius;
    }

    public Circle(double radius, String color, double weight) {
        super(color, weight);
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double findArea() {
        return radius * radius * Math.PI;
    }

    public double findPerimeter() {
        return 2 * radius * Math.PI;
    }

    public boolean equals(Circle circle)
    {
        return this.radius == circle.getRadius();
    }

    public String toString() {
        return "圆的半径= " + radius;
    }

}
